﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using OrbitOne.Elmah.Logic;

namespace OrbitOne.Elmah.Presenter
{
    public class Last100Errors : UserControl
    {
        #region Controls
        protected Repeater rptErrors; 
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var service = new OrbitOneElmahErrorService();
                var errors = service.GetLast100Errors();
                rptErrors.DataSource = errors;
                rptErrors.DataBind();
            }
        }
    }
}
